@extends('user.layouts.head')
@section('content')
    <body>
    <div id="app">
        <div class="wrapper -header-fixed">

        @include('user.layouts.navbar')
        @include('user.layouts.sidebar')

        <!-- 内容页开始-->
            <div class="content-container">
                <div class="container-fluid">
                    <div class="page-content">

                        <nav aria-label="breadcrumb">
                            <ol class="breadcrumb">
                                <li class="breadcrumb-item"><a href="{{ route('dashboard') }}">仪表盘</a></li>
                                <li class="breadcrumb-item active" aria-current="page">发布记录</li>
                            </ol>
                        </nav>

                        <div class="card">
                            <div class="card-body">

                                <div class="form-group">
                                    <div class="row">
                                        <div class="col-lg-10 col-md-7" style="margin-bottom: 10px">
                                            <a href="{{route('games.create')}}" class="btn btn-primary"> 发布 </a>
                                        </div>
                                        <div class="col-lg-2 col-md-5">
                                            <div class="input-group">
                                                <input type="text" class="form-control" id="search" placeholder="搜索...">
                                                <button class="btn btn-primary"
                                                        onclick="window.location.href = '{{ route('games.index') }}?search='+$('#search').val()">
                                                    搜索
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="table-responsive">
                                    <table class="table table-sm table-hover text-center">
                                        <thead>
                                        <tr>
                                            <th style="min-width:50px;">ID</th>
                                            <th style="min-width:135px;">服务器名</th>
                                            <th style="min-width:150px;">服务器IP</th>
                                            <th style="min-width:179px;">开机时间[月/日/时]</th>
                                            <th style="min-width:115px;">线路类别</th>
                                            <th style="min-width:350px;">详细版本介绍</th>
                                            <th style="min-width:110px;">客服QQ</th>
                                            <th style="min-width:70px;">游戏主页</th>
                                            <th style="min-width:300px;">发布类型</th>
                                            <th style="min-width:70px;">连体数量</th>
                                            <th style="min-width:60px;">审核</th>
                                            <th style="min-width:70px;">消费金额</th>
                                            <th style="min-width:160px;">发布时间</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($userGameData as $key => $data)
                                            <tr>
                                                <td>{{($userGameData->currentPage()-1)*16+1+$key}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->server_name}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->server_ip}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->open_time}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->network}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->introduction}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->qq}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"><a href="{{$data->url}}" target="_blank">点击查看</a></td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
                                                    {{explode(',',$data->type )[0] === '1' ? '套黄|' : ''}}
                                                    {{explode(',',$data->type )[1] === '1' ? '全天套黄|' : ''}}
                                                    {{explode(',',$data->type )[2] === '1' ? '通宵推荐|' : ''}}
                                                    {{explode(',',$data->type )[3] === '1' ? '固定通宵|' : ''}}
                                                    {{explode(',',$data->type )[4] === '1' ? '全天精品' : ''}}
                                                </td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->count}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->audit ? '通过':'未通过'}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" class="text-danger">{{$data->consume}}</td>
                                                <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->release_date}}</td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </div>

                            </div> <!-- .card-body -->

                            <!-- 分页 -->
                            <nav class="page-card-pagination">
                                <ul class="pagination justify-content-center">
                                    {{$userGameData->Links()}}
                                </ul>
                            </nav>
                            <!-- end分页 -->

                        </div> <!-- .card -->

                    </div> <!-- .page-content -->
                </div> <!-- .container-fluid -->
            </div> <!-- .content-container -->
        </div> <!-- .wrapper -->
    </div> <!-- #app -->
    <script src="{{ mix('js/app.js') }}"></script>
    <script src="{{ asset('/js/main.js') }}"></script>
    </body>

@endsection
